<template>
  <div id="app">
    <div id="nav-top">
      <div id="nav">
        <!-- <el-menu
        background-color="#000"
        :default-active="activeIndex2"
        @select="handleSelect"
        class="el-menu-demo"
        text-color="#fff"
        active-text-color="#ffd04b"
        mode="horizontal"

      >
        <el-menu-item index="1" @click="goHome">注册页
        </el-menu-item>
        <el-menu-item index="2" @click="goAbout">登录页
        </el-menu-item>
        <el-menu-item index="3" @click="goMain">推荐页
        </el-menu-item>
        <el-menu-item index="4" @click="goResources">资源页
        </el-menu-item>
        <el-menu-item index="5" @click="goMy">个人信息
        </el-menu-item>
        <el-menu-item index="6" @click="goDiscuss">讨论区
        </el-menu-item>
                <el-menu-item index="7" @click="goAdmin">管理页
        </el-menu-item>
                </el-menu-item>
      </el-menu> -->
        <router-link to="/">注册页</router-link> |
        <router-link to="/about">登录页</router-link> |
        <router-link to="/main">推荐页</router-link> |
        <router-link to="/resources">资源页</router-link> |
        <router-link to="/my">个人信息</router-link> |
        <router-link to="/discuss">讨论区</router-link> |
        <router-link to="/admin">管理页</router-link> |
        <router-link to="/upload">上传资源页</router-link>
        <!-- <router-link to="/test">Test</router-link> | -->
      </div>
      <!-- <router-link to="/">注册页</router-link> |
      <router-link to="/about">登录页</router-link> |
      <router-link to="/main">推荐页</router-link> |
      <router-link to="/resources">资源页</router-link> |
      <router-link to="/my">个人信息</router-link> |
      <router-link to="/discuss">讨论区</router-link> |
      <router-link to="/admin">管理页</router-link> |
      <router-link to="/upload">上传资源页</router-link> -->
      <!-- <router-link to="/test">Test</router-link> | -->
    </div>
    <router-view />
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIndex2: "1",
    };
  },
  methods: {
    goHome() {
      this.$router.push("/");
    },
    goAbout() {
      this.$router.push("/about");
    },
    goMain() {
      this.$router.push("/main");
    },
    goResources() {
      this.$router.push("/resources");
    },
    goMy() {
      this.$router.push("/my");
    },
    goDiscuss() {
      this.$router.push("/discuss");
    },
    goAdmin() {
      this.$router.push("/admin");
    },
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style>
#nav {
  background-color: #7e898f;
}
body {
  height: 100vh;
  margin-left: -10px;
  margin-right: -10px;
}
#app {
  margin-top: -10px;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
}

#nav router-link {
  font-weight: bold;
  color: rgb(0, 0, 0);
}
#nav a {
  text-decoration: none;
}

#nav router-link.router-link-exact-active {
  color: #42b983;
}

#nav a {
  color: #fff;
  font-size: 20px;
}
</style>
